package com.ssy.lingxi.report.api.enums;

import com.ssy.lingxi.common.language.LanguageHolder;

import java.util.Arrays;

/**
 * 资金账户操作类型枚举
 * @author 伍将
 * @date 2020/11/18
 * @version 2.0.0
 */
public enum AccountOperateTypeEnum {

    /**
     * 待审核提现
     */
    TO_BE_VALIFY_CASHOUT(1, "待审核提现", "/memberCenter/payandSettle/amountAccountManage/checkWithdraw"),
    /**
     * 待支付提现
     */
    TO_BE_PAY_CASHOUT(2, "待支付提现", "/memberCenter/payandSettle/amountAccountManage/paymentWithdraw");

    /**
     * 编码
     */
    private final Integer code;
    /**
     * 名称
     */
    private final String name;
    /**
     * 链接
     */
    private final String link;


    AccountOperateTypeEnum(Integer code, String name, String link) {
        this.code = code;
        this.name = name;
        this.link = link;
    }

    public static AccountOperateTypeEnum getEnum(Integer code) {
        return Arrays.stream(AccountOperateTypeEnum.values()).filter(e -> e.getCode().equals(code)).findFirst().orElse(null);
    }


    public Integer getCode() {
        return code;
    }

    public String getName() {
        return LanguageHolder.getName(this.getClass(), this.code);
    }

    public String getLink() {
        return link;
    }
}
